package com.just.springbootmessage.activemq.m2;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class M2Consumer2 {
    private Logger logger=LoggerFactory.getLogger(M2Consumer2.class);
    @JmsListener(destination = "q1",containerFactory = "jmsListenerContainerQueue")
    public void receiverQueue(String msg){
        logger.info("consumer2接收到消息："+msg);
    }

    /**
     * 接收topic消息
     */
    @JmsListener(destination = "t1",containerFactory = "jmsListenerContainerTopic")
    public void receiverTopic1(String msg){
        logger.info("consumer2接收到topic消息："+msg);
    }
}
